package homework.day08;

import java.util.*;

/**
 * @Classname: HomeWork01
 * @Author: bromide
 * @CreateTime: 2022/4/6--18:25
 * @Version: V1.0
 * @Description: 改错题
 * <p>
 * 程序需求:向一个List集合中添加10个数字1-10，并将它们
 * 遍历出来并输出到控制台。
 * *
 */
public class HomeWork01 {
    public static void main(String[] args) {
        List<Integer> list = new ArrayList<>();
        for (int i = 1; i < 11; i++) {
            list.add(i);
        }
        System.out.println(list);
        Iterator<Integer> it = list.iterator();
        while (it.hasNext()) {
            Integer in = it.next();
            System.out.println(in);
        }
    }
}